<?php
/**
 * Created by PhpStorm.
 * User: phpzh
 * Date: 2020/5/29
 * Time: 14:52
 */

namespace app\common\model;

use think\Model;

class Base extends Model
{
    public function add($data)
    {

        if(!is_array($data)) {
            exception('传递的参数不合法');
        }
        $this->allowField(true)->save($data);
        return $this->id;
    }
}